import 'dart:io';

import 'SharedData.dart';
import 'package:dds/MyBLE.dart';
import 'package:dds/MyClassicBlue.dart';
import 'package:dds/MyUDP.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';


main(){
  runApp(TheApp());
}

class TheApp extends StatelessWidget{
  @override
  Widget build(BuildContext context) {

    SharedData.init();

    return GetMaterialApp(
      home: MyHome(),
      initialRoute: "/",
      getPages: [
        GetPage(name: "/classic_blue", page: ()=>MyClassicBlue()),
        GetPage(name: "/ble", page: ()=>MyBLE()),
        GetPage(name: "/udp", page: ()=>MyUDP()),
      ],
    );
  }
}

class MyHome extends StatelessWidget{

  @override
  Widget build(BuildContext context){
    return Scaffold(
      appBar: AppBar(title:const Text("HOME"),centerTitle: true,backgroundColor: Colors.indigo,
        titleTextStyle: const TextStyle(color: Colors.white),
      ),
      body:Center(
          child:Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                ElevatedButton(onPressed: (){
                  Get.toNamed("/classic_blue");
                }, child: Image.asset("images/classic.png")),
                const SizedBox(height: 20,),
                ElevatedButton(onPressed: (){
                  Get.toNamed("/ble");
                }, child: Image.asset("images/BLE.png")),
                const SizedBox(height: 20,),
                ElevatedButton(onPressed: (){
                  Get.toNamed("/udp");
                }, child: Image.asset("images/UDP.png")),
              ]
          )
      ),
    );

  }

}